package com.sys.midware.mongo.model;

/**
 * NoSQL DB方案所涉及的表字段的描述类
 * 
 * @author guangfeng
 */
public class MongoColumnAttribute {

    public static enum MongoColumnType {
        STRING,
        INTEGER,
        DOUBLE
    };

    // 此字段的数据类型
    protected MongoColumnType columnType;
    // 此字段是否为主键
    protected boolean isPrimaryKey;
    // 此字段是否唯一
    protected boolean isUnique;
    // 是否为此字段创建索引
    protected boolean isCreateIndex;

    public MongoColumnAttribute() {
    }


    public MongoColumnAttribute(MongoColumnType columnType, boolean isPrimaryKey, boolean isCreateIndex,
            boolean isUnique) {
        this.columnType = columnType;
        this.isCreateIndex = isCreateIndex;
        this.isPrimaryKey = isPrimaryKey;
        this.isUnique = isUnique;
    }


    public MongoColumnType getColumnType() {
        return columnType;
    }


    public void setColumnType(MongoColumnType columnType) {
        this.columnType = columnType;
    }


    public boolean isPrimaryKey() {
        return isPrimaryKey;
    }


    public void setPrimaryKey(boolean isPrimaryKey) {
        this.isPrimaryKey = isPrimaryKey;
    }


    public boolean isUnique() {
        return isUnique;
    }


    public void setUnique(boolean isUnique) {
        this.isUnique = isUnique;
    }


    public boolean isCreateIndex() {
        return isCreateIndex;
    }


    public void setCreateIndex(boolean isCreateIndex) {
        this.isCreateIndex = isCreateIndex;
    }

   
}
